<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SVG Finder - 查找结果</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }
        
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }
        
        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            font-weight: 300;
        }
        
        .page-info {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 1px solid #e9ecef;
        }
        
        .page-info h2 {
            color: #495057;
            margin-bottom: 10px;
            font-size: 1.2em;
        }
        
        .page-info p {
            color: #6c757d;
            margin: 5px 0;
        }
        
        .stats {
            display: flex;
            justify-content: space-around;
            background: #e9ecef;
            padding: 20px;
            border-bottom: 1px solid #dee2e6;
        }
        
        .stat-item {
            text-align: center;
        }
        
        .stat-number {
            font-size: 2em;
            font-weight: bold;
            color: #667eea;
        }
        
        .stat-label {
            color: #6c757d;
            font-size: 0.9em;
        }
        
        .controls {
            padding: 20px;
            background: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }
        
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn-primary {
            background: #667eea;
            color: white;
        }
        
        .btn-primary:hover {
            background: #5a67d8;
            transform: translateY(-2px);
        }
        
        .btn-secondary {
            background: #6c757d;
            color: white;
        }
        
        .btn-secondary:hover {
            background: #5a6268;
        }
        
        .svg-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px;
        }
        
        .svg-card {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        .svg-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        }
        
        .svg-card.selected {
            border-color: #667eea;
            background: #f8f9ff;
        }
        
        .svg-card.selected .svg-preview {
            border-color: #667eea;
        }
        
        .svg-preview {
            height: 200px;
            background: #f8f9fa;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid #e9ecef;
            position: relative;
        }
        
        .svg-preview svg {
            max-width: 100%;
            max-height: 100%;
        }
        
        .svg-info {
            padding: 15px;
        }
        
        .svg-info h3 {
            margin-bottom: 10px;
            color: #495057;
            font-size: 1.1em;
        }
        
        .svg-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 5px;
            margin-bottom: 15px;
            font-size: 0.9em;
        }
        
        .detail-item {
            display: flex;
            justify-content: space-between;
            color: #6c757d;
        }
        
        .detail-label {
            font-weight: 500;
        }
        
        .svg-actions {
            display: flex;
            gap: 10px;
        }
        
        .error-message {
            background: #f8d7da;
            color: #721c24;
            padding: 20px;
            margin: 20px;
            border: 1px solid #f5c6cb;
            border-radius: 6px;
            text-align: center;
        }
        
        .loading {
            text-align: center;
            padding: 50px;
            color: #6c757d;
        }
        
        .loading-spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }
        
        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        
        .empty-state {
            text-align: center;
            padding: 50px;
            color: #6c757d;
        }
        
        .empty-state svg {
            width: 80px;
            height: 80px;
            margin-bottom: 20px;
            opacity: 0.5;
        }
        
        @media (max-width: 768px) {
            .svg-grid {
                grid-template-columns: 1fr;
            }
            .stats {
                flex-direction: column;
                gap: 15px;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header">
            <h1>🔍 SVG Finder</h1>
            <p>从网页中查找和查看 SVG 图像</p>
        </div>

        <div id="loading" class="loading">
            <div class="loading-spinner"></div>
            <p>正在加载 SVG 数据...</p>
        </div>

        <div id="content" style="display: none;">
            <div class="page-info">
                <h2 id="page-title">页面标题</h2>
                <p><strong>URL:</strong> <span id="page-url"></span></p>
                <p><strong>查找时间：</strong> <span id="scrape-time"></span></p>
            </div>

            <div class="stats">
                <div class="stat-item">
                    <div class="stat-number" id="total-svgs">0</div>
                    <div class="stat-label">总 SVG 数</div>
                </div>
                <div class="stat-item">
                    <div class="stat-number" id="total-size">0</div>
                    <div class="stat-label">总大小 (KB)</div>
                </div>
                <div class="stat-item">
                    <div class="stat-number" id="avg-size">0</div>
                    <div class="stat-label">平均大小 (KB)</div>
                </div>
            </div>

            <div class="controls">
                <button class="btn btn-secondary" id="select-all">✅ 全选</button>
                <button class="btn btn-secondary" id="clear-selection">❌ 清除选择</button>
            </div>

            <div id="svg-grid" class="svg-grid"></div>
        </div>

        <div id="error" class="error-message" style="display: none;">
            <h3>❌ 查找 SVG 时出现错误</h3>
            <p id="error-message"></p>
        </div>
    </div>

    <script src="static/js/result.js"></script>
</body>

</html>